UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VtVWM8/O+kjDPRkuZrMljvfnrPpp6lSEBdrlXt7otIQ='
WHERE
key_id = '1f0833430949b5b75d1b735dd99dc0d105c1152fa92b404e41eb57c3c4729643'
AND (
token = 'VtVWM8/O+kjDPRkuZrMljvfnrPpp6lSEBdrlXt7otIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)