UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1WPksTYU/05vXdvHykSvLmid1DkNf9pZiLejZ42Hkps='
WHERE
key_id = 'f5f9ce49a7dac5df9a81a054511d6add865621e30acebd1ad202ffd441d58fff'
AND (
token = '1WPksTYU/05vXdvHykSvLmid1DkNf9pZiLejZ42Hkps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)