UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OvSwJPIlCT8znNviMi8h0iK16eHcOuag/0A6DOl/qCM='
WHERE
key_id = '9ee5d0972cbd3b6f5b8da1f2193e0320eb9b0979eb87ccbe1a3c3f8ef758f630'
AND (
token = 'OvSwJPIlCT8znNviMi8h0iK16eHcOuag/0A6DOl/qCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)