UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UVAaoKneBtoPMYl60LkDuQh+a7PEnYRKQMy3DMGIhhQ='
WHERE
key_id = 'e66ad322dc504ebb6c0d473023fea826eccce4435b5ac879d5c9f59e429ce2b0'
AND (
token = 'UVAaoKneBtoPMYl60LkDuQh+a7PEnYRKQMy3DMGIhhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)