UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r25rTsOC/aYYDXaALlKaj2795SbAhIkAI3wxWDt6diQ='
WHERE
key_id = '6422e0ae8c058fa61eee1c43cc8df0dc4bac0465c524266c4afcf3231cf40b11'
AND (
token = 'r25rTsOC/aYYDXaALlKaj2795SbAhIkAI3wxWDt6diQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)