UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UDri7hzHztg//kbYRBrqCE6Bl19LMOWQ85kKY7xHqU0='
WHERE
key_id = '7eb14295e9dd22aac5817c1c9f1b1d3a617ab98796ba64cc3fa2357ab4a853ad'
AND (
token = 'UDri7hzHztg//kbYRBrqCE6Bl19LMOWQ85kKY7xHqU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)