UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hTVvKUtx22Y1siTj+UqDRXDAAhIAcjsnsrnrZBMB/As='
WHERE
key_id = '531351d607bae89493b2ddfeef584f5f4ddbea1efb26dda962426bf12624728c'
AND (
token = 'hTVvKUtx22Y1siTj+UqDRXDAAhIAcjsnsrnrZBMB/As='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)