UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1+rE1j8JkaZNBh8msMa4U2SyFgl+5wGcUnvRjwQwJHw='
WHERE
key_id = 'b5fe88bf77c2c42fd74dbd0f50b13cf7b77a99b7066e9742e2c6e7c6a695cc08'
AND (
token = '1+rE1j8JkaZNBh8msMa4U2SyFgl+5wGcUnvRjwQwJHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)