UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NI5CYxYXHmbq4HgF+veAIX4Xyq7Fhdn+vIdz3G6K3pA='
WHERE
key_id = 'ee44185faec9d9ef628df852de1e02fdda65eaf3d6864ab3dfcc2ab998f5daa8'
AND (
token = 'NI5CYxYXHmbq4HgF+veAIX4Xyq7Fhdn+vIdz3G6K3pA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)