UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7LeIItF8Oqe13pr8wedkuKQRkOQ2ugW+koJfHXcGcQQ='
WHERE
key_id = '98ff2cd71062787d2523b7fdf5285386ceabe2cf88f339909b96d006a32f57cb'
AND (
token = '7LeIItF8Oqe13pr8wedkuKQRkOQ2ugW+koJfHXcGcQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)