UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g9k48lkr/moH2rfGxnT5Ljy/XjIUWuBt67kgBnbwwZ4='
WHERE
key_id = 'b0cf1367364de34a1154c7dc893af2ae75d35dc2b06a67d0c98a43ea4a9a6d8f'
AND (
token = 'g9k48lkr/moH2rfGxnT5Ljy/XjIUWuBt67kgBnbwwZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)