UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Nfuo3X3aJB0o5HS11+tzHGznKvTwxDHNt9BXrWQLe4='
WHERE
key_id = '3c1cca84cc6ecb6ec0e406cdce2020de16485a526d6b799ed5ebc1efb5135cd5'
AND (
token = '7Nfuo3X3aJB0o5HS11+tzHGznKvTwxDHNt9BXrWQLe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)