UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wLiwd99Rnzi8UuiXxDHdfdFOtbgG11R/QeiR7fbL2RA=' 
WHERE 
  key_id = 'c606278b19f3fca3d71aa8143099958fbac6b1e3c301efb199f46eee204b4f28' 
  AND (
    token = 'wLiwd99Rnzi8UuiXxDHdfdFOtbgG11R/QeiR7fbL2RA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017