UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CNq44rtFazxfYcs7j/J8pg2C30KPHDTM5iXe8LXv/O0='
WHERE
key_id = 'dd4fb60fbc052b785fd098e15c3507e1864706aad4e03772c3571dfcbc892cc3'
AND (
token = 'CNq44rtFazxfYcs7j/J8pg2C30KPHDTM5iXe8LXv/O0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)