UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'joEpOqH3vXyEq9k2Oxdxal2K1jxA6TfZT0vSC2qqdD0=' 
WHERE 
  key_id = '11324eff0b1a11908f65f46b0b5a24b1f4c1207afc709cd83fb96c5cf0c67a6c' 
  AND (
    token = 'joEpOqH3vXyEq9k2Oxdxal2K1jxA6TfZT0vSC2qqdD0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042