UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xMc5B2JKfVcJmzMxMeBLJVEzcLRayjfoNkfn60CPmD8=' 
WHERE 
  key_id = '5a28cd6a6cd308cc7e4b7853f88302c750b2212dfb52de284848b9e55d50c29d' 
  AND (
    token = 'xMc5B2JKfVcJmzMxMeBLJVEzcLRayjfoNkfn60CPmD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028