UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm+iUUvyokDf4nOTBcKCl+P+K6vGWI3hR0V2zun4eYfQ='
WHERE
key_id = '603932c6612589dfc0ce516e1b3800d924fbe7c287307d55d2c2b7f54f55719d'
AND (
token = 'm+iUUvyokDf4nOTBcKCl+P+K6vGWI3hR0V2zun4eYfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)