UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jO3xOFYKLL3h/JB3KZJyIIqqPjbP+sxFBE9hTEZxCeQ='
WHERE
key_id = 'd649ac6902abe8ccdd8300efc91fec58fda42e5a3c88f0def2b619ce494fd0dc'
AND (
token = 'jO3xOFYKLL3h/JB3KZJyIIqqPjbP+sxFBE9hTEZxCeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)