UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VxlG/q54dPKYr+msAkyhXha+LjBRXJc0ALGxI7uyxZ4='
WHERE
key_id = '00d31a44876b7e8e30b7e820b86c5dbf744664e914376c6847221121c6f6d920'
AND (
token = 'VxlG/q54dPKYr+msAkyhXha+LjBRXJc0ALGxI7uyxZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)