UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RtWXzQzW9APFsOArLuYdA+O+ny2i/SwRKBV66e2Zjx4=' 
WHERE 
  key_id = '01763ea8beb137d6b7c38eba989b813c262e024e56bec6937d7bea0d0aa7a631' 
  AND (
    token = 'RtWXzQzW9APFsOArLuYdA+O+ny2i/SwRKBV66e2Zjx4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050