UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R0YvQSTF5ySsAwbyt/PwnWWVG8IZ/gt+hR+ZLCzCoSc='
WHERE
key_id = 'e95bf9ce2cdb57939dc43705f2a4cfde6a09d37945883bc466be14fe08908665'
AND (
token = 'R0YvQSTF5ySsAwbyt/PwnWWVG8IZ/gt+hR+ZLCzCoSc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)