UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qg3i+HCAzPDDIDZXTtQv6diiuSkXWR8aqPnsN2KHW9Y='
WHERE
key_id = '920c6bb2293f76d9c4b8c72c41b42e81f082ffb7822e26cb02ac19d57bc9d29c'
AND (
token = 'qg3i+HCAzPDDIDZXTtQv6diiuSkXWR8aqPnsN2KHW9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)