UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'II1Ivx77B52VqueL1hIWGOHGE7Y8/8SsvTrvURYjLho='
WHERE
key_id = '7724b66c3e7ccc886272ebbd46956cabf31aa5697aec2312d28fce86f214db1e'
AND (
token = 'II1Ivx77B52VqueL1hIWGOHGE7Y8/8SsvTrvURYjLho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)