UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TTy10dbUxGG0uaBxlQeC+VZ915wuuQQffnwwxHMsOio='
WHERE
key_id = '1c5a8006f71c0e160483d797239f5d297bcb8f09baeb7e9085bd59378157a3ab'
AND (
token = 'TTy10dbUxGG0uaBxlQeC+VZ915wuuQQffnwwxHMsOio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)