UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I6FRZSwQoEmin0y8rItrfN5MoDPS3P1hpvLoCj/fZlQ=' 
WHERE 
  key_id = '1940d00e9f5762d069d79d60e32583c35e7db926500d52ca9e71c74c601b8a32' 
  AND (
    token = 'I6FRZSwQoEmin0y8rItrfN5MoDPS3P1hpvLoCj/fZlQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037