UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oo4ID+WDMx2i23/ROuyRFy8pAr5WIbEpLBL/My6zkjE='
WHERE
key_id = 'fd49facf5314a8e9debc05d7d61a3d98175bf717f5ca6bddc5a77657655c86e4'
AND (
token = 'oo4ID+WDMx2i23/ROuyRFy8pAr5WIbEpLBL/My6zkjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)