UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '30jYSGWkjx5iXuCPfeHzkLFcvVTcloWk73dCxL8eAz0='
WHERE
key_id = 'a45f8f6e94b0dfc790b0876b664f34ff609dcf7949b3de13b7da7688c3552696'
AND (
token = '30jYSGWkjx5iXuCPfeHzkLFcvVTcloWk73dCxL8eAz0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)