UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wtHj7RMf+NUoT9HGbO86LTELSqtvZFL3DbXhGzmhPSI='
WHERE
key_id = 'f2ef60eb7c50c9ccf49f15da8d188b84de34e28046c8170fac4c2ab5daedccb8'
AND (
token = 'wtHj7RMf+NUoT9HGbO86LTELSqtvZFL3DbXhGzmhPSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)