UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UHqTiPSVW28lETM0ZPWNpcUDLk/r2cqAt+iXAfA691o=' 
WHERE 
  key_id = '6faeb2924f2993669dd90ce1e01f446fcfb8a9cd83e0606a651a7280916ee076' 
  AND (
    token = 'UHqTiPSVW28lETM0ZPWNpcUDLk/r2cqAt+iXAfA691o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027