UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'STb9bP7g6W4kHem/Wdt/WKaoWuKGH/s3VvbruY1cbZM='
WHERE
key_id = 'ce92407f16a738e7c55626c8dc4562b14266481e37f2fc31baddf83158a35b83'
AND (
token = 'STb9bP7g6W4kHem/Wdt/WKaoWuKGH/s3VvbruY1cbZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)