UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mhVJfO5dyIBIla0EtQdLojhMWn9pVuSj8Lq/OACMMm0='
WHERE
key_id = '1b834668e75f8ab63f1fdf1350094c4e951dae3004e72c47f26499a34096c535'
AND (
token = 'mhVJfO5dyIBIla0EtQdLojhMWn9pVuSj8Lq/OACMMm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)