UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G4R6Dr7o5C+hSrjWxynUYNZWWPgaPDs+WfniKeLYeMY=' 
WHERE 
  key_id = '73f1a67c04f309419b6b90c62b140e4d4f487cabb0e1d716a9c4b7eb6bd4c5cf' 
  AND (
    token = 'G4R6Dr7o5C+hSrjWxynUYNZWWPgaPDs+WfniKeLYeMY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042