UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c+eBVKz9cTtHJmKDsZegTkLHk2hWxmNwz+ny070bJJ0=' 
WHERE 
  key_id = '975a8e1f84d2ceb55268856f868f0d3863da99206131b9a11247fb983382ccd0' 
  AND (
    token = 'c+eBVKz9cTtHJmKDsZegTkLHk2hWxmNwz+ny070bJJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021