UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lpHhVLab7RR+aq7QWp+lhMytcDD9fe0R4ANFWOvduz4=' 
WHERE 
  key_id = 'edf5edb1f10043672fe13c9c52e38c98edadec25ba184138b2d71ff7a73010e0' 
  AND (
    token = 'lpHhVLab7RR+aq7QWp+lhMytcDD9fe0R4ANFWOvduz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022