UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9rJMkDPIydzBy5qvJVYwr/ygOZu4Ev+5bZl1R+UW+0w='
WHERE
key_id = '42d9f620a072c110a19ce9544a85f001450a525f56276bc38a786b4b03ab3708'
AND (
token = '9rJMkDPIydzBy5qvJVYwr/ygOZu4Ev+5bZl1R+UW+0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)