UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bXo+IMiIABQ5P/FYaQqbo6+IW4AOovI92Bvli9zAbOs=' 
WHERE 
  key_id = '6c5c1d7b326d0e570aaf70af2312deae3b59bb5315b64f82f6c888b24f39bbbc' 
  AND (
    token = 'bXo+IMiIABQ5P/FYaQqbo6+IW4AOovI92Bvli9zAbOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054