UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mPZvWy6pV59wDbMwRdj0XwZaEZRh8mNobST4A2sUUz0='
WHERE
key_id = '61e43356d161e9f0e9c1114e4cbdd712bababa59a009ea7a9ddab7750b4438ea'
AND (
token = 'mPZvWy6pV59wDbMwRdj0XwZaEZRh8mNobST4A2sUUz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)