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