UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'epm/ydhc5qn4AQAYJyVxFizCFMw5HfRZpzYsw19aWEY=' 
WHERE 
  key_id = 'd929fd287ee18f07e274f634dc0fc9592a1a594b70c8b0cf158962a02d24d384' 
  AND (
    token = 'epm/ydhc5qn4AQAYJyVxFizCFMw5HfRZpzYsw19aWEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037