UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2GVTrLt9k1B2P/rIsDoxXn8BzMH53cmxdpDBHIu8vbM='
WHERE
key_id = 'fd27031c4393198cdacbb4f4cddd3cb0aa41e4360eaec1e71522deae9b5bbc17'
AND (
token = '2GVTrLt9k1B2P/rIsDoxXn8BzMH53cmxdpDBHIu8vbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)