UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VJNecRcPr5aLQMhB6+GtXYEZ1jqWK3AhGggo1h1p45U=' 
WHERE 
  key_id = '442ddb5ea2b45ef57a349b9c526e8f0d57b554a33f2f06b4b46ae6e6e537f392' 
  AND (
    token = 'VJNecRcPr5aLQMhB6+GtXYEZ1jqWK3AhGggo1h1p45U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056