UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pnMePKvO8QWj9N2MuJ1yjql5+yA+hGIcAolAsVpG9uE='
WHERE
key_id = '00264c4df045d89a698f571279fa23fbaab1077945a4438fbf20ef45652aedc2'
AND (
token = 'pnMePKvO8QWj9N2MuJ1yjql5+yA+hGIcAolAsVpG9uE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)