UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jQpZC4WahuTCRqv0KaDWz2k9r9E0XSPE5RXEnsVAXXY=' 
WHERE 
  key_id = 'fd8ac8cd421af52c3fe1916ff43b6a5a73081ff0a970642e5d09651355265a7f' 
  AND (
    token = 'jQpZC4WahuTCRqv0KaDWz2k9r9E0XSPE5RXEnsVAXXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031